Ignoring Files
To exclude specific files or patterns from being processed by the MadQualityPluginII, you can utilize the .mqignore file. This file functions similarly to a .gitignore file, allowing you to specify which files the plugin should ignore during its operations.
Creating and Configuring the .mqignore Fileβ
-
Create the
.mqignoreFile:- You can place a
.mqignorefile in the root directory of your project (where the.flprjfile is located) or in any subdirectory where you want specific ignore rules to apply. - The plugin checks
.mqignorefiles hierarchically, starting from the file's directory and walking up to the project root.
- You can place a
-
Edit the
.mqignoreFile:- Open the
.mqignorefile in a text editor like Notepad. - Add the filenames or patterns of the files you wish to exclude from processing. Each pattern or filename should be on a new line.
- Open the
Examples of .mqignore Entriesβ
-
Ignore a Specific File: To ignore a specific file, simply add its name to the
.mqignorefile. For example, to ignoreMySnippet.flsnp, add the following line:MySnippet.flsnp -
Ignore All Files of a Specific Type: To ignore all files of a particular type, use a wildcard
*. For example, to ignore all.flsnpfiles, add this line:*.flsnp -
Ignore Files in a Specific Subdirectory: To ignore all files within a specific subdirectory, include the directory name followed by a backslash and a wildcard. For example, to ignore all files in the
JANsubdirectory:\JAN\*Note: You can use either forward slashes (
/) or backslashes (\) - the plugin will handle both. -
Ignore Files Based on Complex Patterns: You can use standard glob patterns to match multiple files. For example, to ignore all XML files that start with
temp_:temp_*.xml
Practical Exampleβ
Consider this project structure:
MyProject\
MyProject.flprj
.mqignore (contains: \Temp\*)
Content\
.mqignore (contains: \JAN\*)
Topics\
MyTopic.htm (processed)
JAN\
Read_the_manual.htm (ignored by Content\.mqignore)
Temp\
Draft.htm (ignored by root .mqignore)
When processing Read_the_manual.htm:
- Plugin checks
Content\JAN\- no.mqignorefound - Plugin checks
Content\- finds.mqignorewith\JAN\*pattern - File matches pattern
Content\JAN\*β File is ignored
How It Worksβ
- When the Mad Quality Plugin processes a file, it searches for
.mqignorefiles starting from the file's directory and walking up the directory tree. - The search continues until it either:
- Finds a matching ignore pattern in any
.mqignorefile (the file is then ignored), or - Reaches the project root directory (where the
.flprjfile is located) without finding a match (the file is processed)
- Finds a matching ignore pattern in any
- If a file matches any pattern in any
.mqignorefile along the path, it is excluded from all plugin processing activities. - This hierarchical approach allows you to have different ignore rules at different levels of your project:
- Place a
.mqignorein your project root for project-wide ignore patterns - Place additional
.mqignorefiles in subdirectories for folder-specific ignore patterns
- Place a
- The plugin will never search outside your project root (beyond the
.flprjfile location) - This setup helps in focusing the quality checks on relevant files and can improve processing times by skipping unnecessary files.
Best Practicesβ
- Regular Updates: Keep the
.mqignorefile updated as new files or directories are added to your project that you wish to ignore. - Use Comments: You can add comments in your
.mqignorefile by starting the line with a#. This is useful for documenting why certain files or patterns are ignored.# Ignore backup snippets
*.bak
By properly configuring the .mqignore file, you can efficiently manage which files are processed by the Mad Quality Plugin, ensuring that the plugin's operations are both relevant and optimized for your project's needs.